import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JTabbedPane;
import javax.swing.UIManager;

public class main {

    public static void main(String[] args) {
        try {
            UIManager.setLookAndFeel(
                    UIManager.getSystemLookAndFeelClassName());
        } catch (Exception e) { }
        
        JFrame principal = new JFrame();
        
        EquipamentoCRUDForm formEquipamento = new EquipamentoCRUDForm();
        GerarRelatorio tabGerarRelatorio = new GerarRelatorio();
        CalcularPeso tabCalcularPeso = new CalcularPeso();
        JTabbedPane panel = new JTabbedPane();
        panel.addTab("Cadastro Equipamento", formEquipamento.novoForm());
        panel.addTab("Controle Peso", tabCalcularPeso.novoForm());
        panel.addTab("Relatório Distância", tabGerarRelatorio.novoForm());
        principal.add(panel);
        
        principal.addWindowListener(new main.CloseListener());
        principal.setTitle("Cooperativa de Reciclagem - Módulo de Equipamento");
        principal.setSize(400, 400);
        principal.setVisible(true);
    }
    
    public static class CloseListener extends WindowAdapter {
        
        @Override
        public void windowClosing(WindowEvent e) {
            e.getWindow().setVisible(false);
            System.exit(0);
        }
    }
}